#
# Copyright © 2021 深圳百问网科技有限公司 All Rights Reserved.
# 视频在线学习：https://www.100ask.net
# 硬件购买地址：https://shop502068889.taobao.com
#
# SPDX-License-Identifier: BSD-3-Clause
#

"""
接线：
    VCC --- 5V or 3.3V
    GND --- GND
    SDA --- 21
    SCL --- 22
"""

from machine import I2C, Pin, SoftI2C
from i2c_lcd1602 import I2cLcd

DEFAULT_I2C_ADDR = 0x27
#soft_i2c = SoftI2C(scl=Pin(22), sda=Pin(21), freq=200000)
#lcd = I2cLcd(soft_i2c, DEFAULT_I2C_ADDR, 2, 16)
hw_i2c = I2C(scl=Pin(22), sda=Pin(21), freq=200000)
lcd = I2cLcd(hw_i2c, DEFAULT_I2C_ADDR, 2, 16)
lcd.putstr("Hello World ~~\nwww.100ask.net")
lcd.blink_cursor_on()
while 1:
    pass
